const { PureComponent } = require("react");


class DemoA extends PureComponent {
  fn() {
    this.refs.box.style.color = "blue";
  }
  render() {
    return (
      <div>
        <h1>类组件</h1>
        {/* 把ref写在html标签上，目的就是为了获取DOM */}
        <div ref="box">我是一个div</div>
        <button onClick={() => this.fn()}>点我</button>
      </div>
    )
  }
}

export default DemoA;